package com.xiaohai.generator.common.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Set;

/**
 * 分页
 * @author wangchenghai
 * @date 2022/04/06 10:11
 */
@ApiModel(value="分页对象")
@Data
public class PageEntity {
    @ApiModelProperty(value = "是否分页")
    private boolean paginated;

    @ApiModelProperty(value = "页码", name = "pageNum", dataType = "Integer")
    private Integer pageNum;

    @ApiModelProperty(value = "每页数量", name = "pageSize", dataType = "Integer")
    private Integer pageSize;

    @ApiModelProperty(value = "排序字段", name = "orderBy", dataType = "String")
    private String orderBy;

    @ApiModelProperty(value = "是否倒序", name = "desc", dataType = "Boolean")
    private Boolean desc;

    @ApiModelProperty("是否展示历史数据")
    private boolean showHistory;

    @ApiModelProperty(hidden = true)
    private Set<Long> companyIds;

    @ApiModelProperty(hidden = true)
    private Set<Long> customerIds;

    public PageEntity() {
        this.paginated = true;
        this.pageNum = 1;
        this.pageSize = 10;
    }
}
